<%--
  Created by IntelliJ IDEA.
  : admin
  Date: 2016/12/27
  Time: 10:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c" %>

<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://"
          + request.getServerName() + ":" + request.getServerPort()
          + path + "/";
  //  String dd=(String)request.getAttribute("user");
   // out.print(${user}+"ddddddddddddddddddddddddd");
%>
<html>
<head>
    <title>测试</title>
    <script type="text/javascript" src="<%=basePath %>js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript">

     $(document).ready(function(){
             var content="<td width='98' align='center'>dddddd</td><td width='200' align='center'>dd</td><td width='145' align='center'><a href=''>删除</a> <a href=''>修改</a></td>";
           var tb="";//"<table border="1"><tr><td>dd</td></tr><tr><td>dd</td></tr><tr><td>dd</td></tr></table>";
  $.ajax({
               type: "POST",
               url: "<%=basePath%>userController/getUser",
               success: function(msg){
                     for(var i=0;i<msg.userList.length;i++){
                         alert(msg.userList[i].name);
                         tb+="<td width='98' align='center'>dddddd</td><td width='200' align='center'>dd</td><td width='145' align='center'><a href=''>删除</a> <a href=''>修改</a></td>";
                   }

               }
           });
         content+=tb;
         $("#tb_bd").html(content);
          // $("#tb").html(tb);
        });
    </script>
</head>

<body>

<table width="457" border="1"id="tb" >
    <tr>
        <td colspan="3" align="center"><h2><Strng>测试</Strng></h2></td>
    </tr>
    <tr>
        <td width="98" align="center">ID</td>
        <td width="200" align="center">名称</td>
        <td width="145" align="center">操作</td>
    </tr>
    <tr id="tb_bd">
    </tr>
</table>

</body>
</html>
